type T = {
  title: string
  desc?: string
  faqs: { question: string; answer: string }[]
}

export default function FAQ(props: T) {
  const { title, desc, faqs } = props
  return (
    <div className="flex flex-col gap-10 py-row max-sm:py-sRow">
      <div className="flex flex-col gap-3">
        <h2 className="leading-tight text-secondTitle font-bold text-black text-center">
          {title}
        </h2>
        {desc && (
          <div className="text-desc text-menuTxt text-center">{desc}</div>
        )}
      </div>
      <div className="flex flex-col gap-7">
        {faqs?.map((item, index) => (
          <div key={index} className="flex flex-col gap-4 text-menuTxt">
            <div className="font-bold">{item.question}</div>
            <div className="p-3.5 rounded-2xl bg-[#F9EFFF]">{item.answer}</div>
          </div>
        ))}
      </div>
    </div>
  )
}
